package likou;

/**
 * @author: Tangxz
 * @email: 1171702529@qq.com
 * @cate: 2020/11/12 17:01
 */
public class _922 {
    public int[] sortArrayByParityII(int[] A) {
        int j =1 ;
        for (int i = 0; i < A.length; i+=2) {
            if (A[i]%2==1){
                while (A[j]%2==1){
                    j+=2;
                }
                int temp = A[i];
                A[i]=A[j];
                A[j]=temp;
            }
        }
        return A;
    }
}
